#ifndef __MAIN_H__
#define __MAIN_H__

#include "app_types.h"
#ifdef __AVR__
	#include <avr/pgmspace.h>
#else
	#define prog_char	char
#endif

#define HEAP_SIZE			0x500 // 1280Byte

extern const prog_char version[];
extern uint8_t heap[HEAP_SIZE];
extern char debug_str[30];

uint8_t getState(uint8_t idx);
void setState(uint8_t idx, uint8_t state);
uint16_t getBusValue_16b(uint8_t idx);
void setBusValue_16b(uint8_t idx, uint16_t value);
uint8_t getStateInput(uint8_t idx);
void setStateOutput(uint8_t idx, uint8_t state);
uint16_t getAnalogInputValue_16b(uint8_t idx);
void setAnalogOutputValue_16b(uint8_t idx, uint16_t value);

void init_system();

#endif // __MAIN_H__
